package com.zang.singleton;

/**
 * 简单锁
 *
 * @author Zhang Qiang
 * @Date 2019/9/20 11:38
 */
public class SimpleMultiThreadSingleton {

    private static SimpleMultiThreadSingleton instance = null;

    private SimpleMultiThreadSingleton(){
        System.out.println("create SimpleMultiThreadSingleton");
    }

    public static SimpleMultiThreadSingleton getInstance(){
        synchronized (SimpleMultiThreadSingleton.class){
            if (instance == null){
                instance = new SimpleMultiThreadSingleton();
            }
        }
        return instance;
    }


}
